import 'package:flutter/cupertino.dart';

class TestPeople {
  int type;
  String name;

  TestPeople(this.type, this.name);
}

void main() {
  //定义集合
  List<TestPeople> testList = [
    TestPeople(1, "张三"),
    TestPeople(2, "李四"),
    TestPeople(1, "王五")
  ];

  var newList =
      testList.where((people) => people.type == 1).map((people) => people.name);

  debugPrint("${newList.runtimeType}");
}
